package com.example.lemis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.lemis.model.domain.Doorplate;
import com.example.lemis.model.domain.DoorplateApply;
import com.example.lemis.model.dto.DoorplateApplyDTO;
import com.example.lemis.model.dto.DoorplateReissueDTO;
import com.example.lemis.model.dto.PageDTO;
import com.example.lemis.model.vo.DoorplateApplyVO;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 管理门牌每次审批数据 Mapper 接口
 * </p>
 *
 * @author lxp
 * @since 2025-06-24
 */
public interface DoorplateApplyMapper extends BaseMapper<DoorplateApply> {


    void insertApply(@Param("dto") @NotNull DoorplateApplyDTO dto,
                     @Param("creatorId") @NotNull Long creatorId,
                     @Param("status") @NotNull Long status);

    DoorplateApplyVO selectByIdWithClazzStreet(@Param("id") @NotNull Long id,
                                               @Param("clazzId") @NotNull Long clazzId,
                                               @Param("streetId") @NotNull Long streetId);

    void reissueApply(@Param("dpr") DoorplateReissueDTO doorplateReissue, @Param("dp") Doorplate doorplate);

    Long getCurrentLevel(@Param("id") @NotNull(message = "id 不能为空") Long id);

    DoorplateApply selectNearApply(@Param("dpr") DoorplateReissueDTO doorplateReissue);

    Page<DoorplateApplyVO> queryApplyList(@Param("page") Page<DoorplateApplyVO> page,
                                          @Param("streetIds") List<Long> streetIds,
                                          @Param("perms") List<String> perms);
}
